#include "params.h"

void ini_cosmo_params( cosmo_params *cp, dictionary *dict ){
    cp->h       = iniparser_getdouble(dict, "cosmo_params:h", 0.7);
    cp->Tcmb    = iniparser_getdouble(dict, "cosmo_params:Tcmb", 2.725);
    cp->Omega_b = iniparser_getdouble(dict, "cosmo_params:Omega_b", 0.046);
    cp->Omega_c = iniparser_getdouble(dict, "cosmo_params:Omega_c", 0.224);
    cp->ns      = iniparser_getdouble(dict, "cosmo_params:ns", 1);
    cp->Yp      = iniparser_getdouble(dict, "cosmo_params:Yp", 0);
    
    cp->Omega_r = 5.042E-5; // taken from "How to calculate the CMB spectrum"
    cp->Omega_L = 1.0 - cp->Omega_r - cp->Omega_b - cp->Omega_c;
    
    printf("#--> initialized cosmological parameters.\n");
};

void print_cosmo_params( cosmo_params *cp ){
    printf("h       = %10.5f\n", cp->h);
    printf("Tcmb    = %10.5f\n", cp->Tcmb);
    printf("Omega_b = %10.5f\n", cp->Omega_b);
    printf("Omega_r = %10.5f\n", cp->Omega_r);
    printf("Omega_c = %10.5f\n", cp->Omega_c);
    printf("Omega_L = %10.5f\n", cp->Omega_L);
    printf("ns      = %10.5f\n", cp->ns);
    printf("Yp      = %10.5f\n", cp->Yp);
}
